﻿using MediatR;
using RBAC.LuFang.API.Application.Command.UserCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.UserHandler
{
    //显示县
    public class CountySelectCommandHandler:IRequestHandler<CountySelectCommand,List<County>>
    {
        private readonly IUserService _userService;

        public CountySelectCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<List<County>> Handle(CountySelectCommand request, CancellationToken cancellationToken)
        {
            return await _userService.GetCounty(request.thecityId);
        }
    }
}
